package com.buding.fx.entity;

import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class CodeFormatEntity {
    private SimpleBooleanProperty isSelect= new SimpleBooleanProperty(false);

    private SimpleStringProperty id;

    private SimpleStringProperty name;

    private SimpleStringProperty eng;

    private SimpleStringProperty remark;

    private SimpleStringProperty dateType;

    private List<String> buttons;

    public static ObservableList<CodeFormatEntity> getDemoList(){
        List<CodeFormatEntity> returnList = new ArrayList<>();
        for (int i = 0; i<10; i++){
            CodeFormatEntity  codeFormatEntity = new CodeFormatEntity();
            codeFormatEntity.setId(new SimpleStringProperty(i+1+""));
            codeFormatEntity.setName(new SimpleStringProperty("测试"+i));
            codeFormatEntity.setEng(new SimpleStringProperty("cesh"));
            codeFormatEntity.setRemark(new SimpleStringProperty("这是一个备注"));
            codeFormatEntity.setDateType(new SimpleStringProperty("1"));
            List<String> buttons = new ArrayList<>();
            buttons.add("编辑");
            buttons.add("删除");
            codeFormatEntity.setButtons(buttons);
            returnList.add(codeFormatEntity);
        }
        ObservableList<CodeFormatEntity> data =
                FXCollections.observableArrayList(returnList);

        return data;
    }


}
